package FWK.components;

import java.awt.Dimension;

import javax.swing.JLabel;

import FWK.util.FwkMessageManager;

public class FwkLabel extends JLabel implements FwkComponent {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public FwkLabel(String property, Integer characters, int rigthPadding, boolean isStatic) {
		super();
		String text = FwkMessageManager.getInstance().getProperty(property) + ": ";
		String padding = "";
		int i = 0;
		while (i < rigthPadding) {
			padding += " ";
			i++;
		}
		text = padding + text;
		this.setText(text);
		if (characters != null) {
			Dimension dim = new Dimension(characters, 20);
			this.setSize(dim);
			this.setPreferredSize(dim);
			this.setMinimumSize(dim);
			if (isStatic)
				this.setMaximumSize(dim);
		}
	}

	public FwkLabel(String property) {
		this(property, null, 0, false);
	}

	@Override
	public void activate() {
		this.setEnabled(true);

	}

	@Override
	public void standBy() {
		this.setEnabled(false);
	}

}
